﻿package org.cshoo.sys.data.dao;

import java.util.List;

import org.cshoo.common.data.dao.BaseDAO;
import org.cshoo.sys.data.entity.Organization;
import org.cshoo.sys.data.idao.IOrganizationDAO;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

public class OrganizationDAO extends BaseDAO implements IOrganizationDAO{

	@Override
	public List findRootOrganizationList() {
		DetachedCriteria criteria = DetachedCriteria.forClass(Organization.class);
		criteria.add(Restrictions.isNull("parent"));//根据父节点为空的原理查询
		return super.findObjectListByCriteria(criteria);
	}

}
